﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ShopsAjax.aspx.cs" Inherits="ShoppingApp.ShopsAjax" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ShoppingAppDbConnectionString %>" 
                                SelectCommand="SELECT [Shop_Id], [Name] FROM [Shops]"></asp:SqlDataSource>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="GridView" runat="server" AutoGenerateColumns="false" 
                Width="149px" DataSourceID="SqlDataSource1" ShowHeader="true" onrowdatabound="GridView2_RowDataBound1" 
                >
                <Columns>
                    <asp:TemplateField>
                        <HeaderTemplate>
                            asdf
                        </HeaderTemplate>
                        <ItemTemplate>
                         <asp:Panel ID="Panel1" runat="server" Visible="true">
                             <asp:GridView ID="GridView3" runat="server" Width="100" DataSourceID="SqlDataSource1">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <%# Eval("Name") %>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                             </asp:GridView>
                                                <%-- <asp:Button runat="server" Id="btn1" Text="text"/> --%>
                                                <%--<asp:Image runat="server" ID="ImgCollapsible" ImageUrl="Images/triangle.jpg"
                                                Width="30px"/>

                                                <%# Eval("Name") %> kjh kj --%>
                         </asp:Panel>
                            <asp:SqlDataSource ID="SqlDataSource2" runat="server"
                            ConnectionString="<%$ ConnectionStrings:ShoppingAppDbConnectionString %>" 
                                SelectCommand="SELECT [ChainName] FROM [Shops] WHERE (Shop_Id = 11)">
                                
                            </asp:SqlDataSource>
                
                            <asp:Panel ID="Panel2" runat="server">
                                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" DataSourceID="SqlDataSource2">
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <%# Eval("ChainName") %>        
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    
                                </asp:GridView>
                            </asp:Panel>
                            <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="Panel3" 
                            ExpandControlID="Panel1" CollapseControlID="Panel1" Collapsed="true" ImageControlID="ImgCollapsible">
                            </asp:CollapsiblePanelExtender>
                            
                            <%--<asp:GridView ID="GridViewMaster" runat="server" AutoGenerateColumns="false">
                                <Columns>
                                    <asp:TemplateField>
                                        <ItemTemplate>
                                            <asp:Panel ID="Panel1" runat="server" Visible="true">
                                                <asp:Button runat="server" Id="btn1" Text="text"/>
                                                <%# Eval("Name") %>
                                            </asp:Panel>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                </Columns>
                            </asp:GridView> --%>
                             
                        </ItemTemplate>
                        
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <%# Eval("Shop_Id") %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
            </asp:GridView>
            
            <asp:Button runat="server" ID="btn" Text="Button"/>
        </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>
